package com.pactera.redisrelated;

import com.pactera.redisrelated.redis.RedisIdGenerator;
import com.pactera.redisrelated.redis.RedisService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@Slf4j
public class Task1_Q5_Application implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(Task1_Q5_Application.class, args);
    }

    @Autowired
    RedisService redisService;

    @Autowired
    RedisIdGenerator idGenerator;

    @Override
    public void run(String... args) throws Exception {
        // 1、实现分数排名或者排行榜；
        redisService.rank();

        // 2、实现全局ID生成 及模拟测试
        idGenerator.test();

        // 基于 Bitmap 实现 id 去重；
        // todo

        // 基于 HLL 实现点击量计数13
        // todo
    }


}
